package com.eastfair.questionnaire.dto;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.eastfair.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.kafka.support.JacksonUtils;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 问卷
 * </p>
 *
 * @author yuwx
 * @since 2021-08-18
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Builder
@ApiModel(value = "QuestionnaireDTO", description = "问卷")
public class QuestionnaireDTO extends Entity<Long> implements Serializable {
    public static void main(String[] args) {
        System.out.println(JSONUtil.parseObj(new QuestionnaireDTO(), false).toString());
    }
    private static final long serialVersionUID = 1L;

    public interface validateBase {}
    public interface validateGet{}
    public interface validateSave {}
    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")
//    @NotNull(groups = {validateBase.class, validateSave.class})
    private Long projectId;
    /**
     * 问卷名
     */
    @ApiModelProperty(value = "问卷名")
    @NotNull(groups = { validateSave.class})
    private String name;
    /**
     * 问卷英文名名
     */
    @ApiModelProperty(value = "问卷英文名名")
    private String enName;

    @ApiModelProperty(value = "")
    @Size(max = 128, message = "长度不能超过128")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "")
    private String remark;

    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    private Integer isEnable;
    /**
     * 是否删除(默认0：未删除 1:已删除)
     */
    @ApiModelProperty(value = "是否删除(默认0：未删除 1:已删除)")
    private Integer isDelete;
    /**
     * 主体类型
     */
    @ApiModelProperty(value = "主体类型")
    private String subjectType;
//    /**
//     * 主体id
//     */
//    @ApiModelProperty(value = "主体id")
//    private Long subjectId;
}
